// @ts-ignore
/* eslint-disable */
import request from "@/request";

/** 录入或更新航班信息 POST /api/SystemManage/createOrUpdateFlight */
export async function postSystemManageCreateOrUpdateFlight(
  body: API.FlightInfoDto,
  options?: { [key: string]: any }
) {
  return request<any>("/api/SystemManage/createOrUpdateFlight", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取系统中所有的缓存 GET /api/SystemManage/getAllCaches */
export async function getSystemManageGetAllCaches(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getSystemManageGetAllCachesParams,
  options?: { [key: string]: any }
) {
  return request<Record<string, any>>("/api/SystemManage/getAllCaches", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 取得系统配置 GET /api/SystemManage/getConfig */
export async function getSystemManageGetConfig(options?: {
  [key: string]: any;
}) {
  return request<API.SystemConfigDto>("/api/SystemManage/getConfig", {
    method: "GET",
    ...(options || {}),
  });
}

/** 获取航班信息 GET /api/SystemManage/getFlightInfos */
export async function getSystemManageGetFlightInfos(
  body: API.GetAirlineInput,
  options?: { [key: string]: any }
) {
  return request<API.FlightInfoDto[]>("/api/SystemManage/getFlightInfos", {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取某个用户的缓存信息 GET /api/SystemManage/getUserCache */
export async function getSystemManageGetUserCache(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getSystemManageGetUserCacheParams,
  options?: { [key: string]: any }
) {
  return request<API.LoginResultInfo>("/api/SystemManage/getUserCache", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 模拟下单 POST /api/SystemManage/mockShopping */
export async function postSystemManageMockShopping(
  body: API.ShoppingInput,
  options?: { [key: string]: any }
) {
  return request<any>("/api/SystemManage/mockShopping", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 存在预设信息的情况下，跳过正常步骤下单 POST /api/SystemManage/mockShoppingByPreset */
export async function postSystemManageMockShoppingByPreset(
  body: API.ShoppingInput,
  options?: { [key: string]: any }
) {
  return request<any>("/api/SystemManage/mockShoppingByPreset", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 设置所有有效用户的下单预设信息 POST /api/SystemManage/presetShoppingInfo */
export async function postSystemManagePresetShoppingInfo(options?: {
  [key: string]: any;
}) {
  return request<any>("/api/SystemManage/presetShoppingInfo", {
    method: "POST",
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /api/SystemManage/syncFlightInfo */
export async function getSystemManageSyncFlightInfo(options?: {
  [key: string]: any;
}) {
  return request<any>("/api/SystemManage/syncFlightInfo", {
    method: "GET",
    ...(options || {}),
  });
}

/** 设置系统配置 POST /api/SystemManage/updateConfig */
export async function postSystemManageUpdateConfig(
  body: API.SystemConfigDto,
  options?: { [key: string]: any }
) {
  return request<any>("/api/SystemManage/updateConfig", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}
